package com.example.bilibili_miaosha.mapper;

import com.example.bilibili_miaosha.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
* 弓川hello mybatisplus
 * @author gongchuan
 * @since 2022-04-01
 */
@Mapper
@Repository
public interface OrderMapper extends BaseMapper<Order> {

    @Insert("INSERT INTO seckill.t_order (user_id,goods_id,goods_name,goods_count,goods_price,order_channel,status,create_time) VALUES (#{userId},#{goodsId},#{goodsName},#{goodsCount},#{goodsPrice},#{orderChannel},#{status},#{createTime})")
    void insertOrder(Long userId, Long goodsId, String goodsName, Integer goodsCount, BigDecimal goodsPrice, Integer orderChannel, Integer status, Date createTime);
}
